<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/16
 * Time: 18:55
 */
class DB{
    static $obj=null;
    private function _construct(){
        echo"mysql linked......";
    }
    static function getObj(){
        if(is_null(self::$obj)){
            self::$obj=new self();
        }
        return self::$obj;
    }
    public function select(){
        echo "select data......";
    }
}
var_dump(DB::getObj());
var_Dump(DB::getObj());